#!/bin/bash
#change
Usage(){
        echo "Error!!!"
        exit 1
}
num=$1
m=0
while ((m<${#num}));do
        [[ ${num:$m:1} = [0-9] ]] || Usage
        ((m++))
done
[[ $# -ne 1 || $1 == 0* ]] && Usage
bin=$(
while ((num!=0));do
        b=$((num%2))
        echo -n $b
        num=$((num/2))
done
)
echo -n $1\'s BinCode is:
n=${#bin}
while ((n>=0));do
        echo -n ${bin:$n:1}
        ((n--))
done
echo
echo Convert Finish!
